package com.netx.data;
import com.netx.generics.util.Strings;

class Value {

	private final String _name;
	private final Object _value;

	// For Entity:
	Value(String fieldName, Object value) {
		if(fieldName == null) {
			throw new IllegalArgumentException("null field name");
		}
		_name = fieldName.toLowerCase();
		if(value instanceof String && Strings.isEmpty((String)value)) {
			_value = null;
		}
		else {
			_value = value;
		}
	}

	// For Entity:
	String getFieldName() {
		return _name;
	}
	
	// For Entity:
	Object getValue() {
		return _value;
	}

}
